<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body ng-app="myApp" ng-controller="myController">
	<input type="text" ng-model="name">
	<script src="angular.js"></script>
	<script>
		var app = angular.module("myApp",[]);
		app.controller("myController",["$scope",function($scope){
			$scope.name="xiaoming";
			$scope.$watch("name",function(now,old){
				console.log(now,old);
			});
		}]);
	</script>
</body>
</html>
